package com.jianqiao.delivery.delivery.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.jianqiao.delivery.delivery.domain.WarehouseAddEntity;
import com.jianqiao.delivery.delivery.mapper.WarehouseAddMapper;
import com.jianqiao.delivery.delivery.service.WarehouseAddService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * author: cyx
 * create: 2024/6/4 15:07
 **/
@Service
public class WarehouseAddServiceImpl extends ServiceImpl<WarehouseAddMapper, WarehouseAddEntity> implements WarehouseAddService {

    @Autowired
    private WarehouseAddMapper warehouseAddMapper;

    @Override
    public PageInfo<WarehouseAddEntity> selectWarehouseList(int pageSize, int pageNum) {
        PageHelper.startPage(pageNum ,pageSize);
        LambdaQueryWrapper<WarehouseAddEntity> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(WarehouseAddEntity::getDelFlag ,"1");
        List<WarehouseAddEntity> warehouseList = warehouseAddMapper.selectList(queryWrapper);
        PageInfo<WarehouseAddEntity> warehousePageInfo = new PageInfo<>(warehouseList);
        return warehousePageInfo;

    }

}
